package com.darker.yygh.task.scheduled;

import com.darker.common.rabbit.constant.MqConst;
import com.darker.common.rabbit.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@EnableScheduling
@Component
public class scheduledTask {

    @Autowired
    private RabbitService rabbitService;

    //每天八点执行方法
    @Scheduled(cron = "0 0 8 * * ? " )
    public void taskPatient(){
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK,MqConst.ROUTING_TASK_8,"");
    }
}
